package test1;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    static class Point {

        int x, y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public String toString() {
            return "(" + x + "," + y + ")";
        }
    }

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        int n = input.nextInt();    // 点的个数
        int m = input.nextInt();    // 查询的个数
        List<Point> A = new ArrayList<>();
        List<Point> B = new ArrayList<>();
        List<Boolean> res = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            int x = input.nextInt();
            int y = input.nextInt();
            Point p = new Point(x, y);
            String ch = input.next();
            if (ch.equals("A"))
                A.add(p);
            else
                B.add(p);
        }

        for (int i = 0; i < m; i++) {
            int a = input.nextInt();
            int b = input.nextInt();
            int c = input.nextInt();

            int indexA = 0;
            int indexB = 0;
            boolean flagA = false;
            boolean flagB = false;
            for (Point p : A) {
                int z = a + b * p.x + c * p.y;
                if (z > 0)
                    indexA ++;
            }
            if (indexA == A.size() || indexA == 0)
                flagA = true;

            for (Point p : B) {
                int z = a + b * p.x + c * p.y;
                if (z > 0)
                    indexB ++;
            }
            if (indexB == B.size() || indexB == 0)
                flagB = true;

            if (flagA && flagB && (indexA == 0 || indexB == 0))
                res.add(true);
            else
                res.add(false);
        }

        for (boolean flag : res) {
            if (flag)
                System.out.println("Yes");
            else
                System.out.println("No");
        }
    }
}
